package com.vq3.digitalizationsoftwareintegrates.Mapper.Spot_Check;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.vq3.digitalizationsoftwareintegrates.Entity.Spot_Check.S_C_DatesEntity;
import com.vq3.digitalizationsoftwareintegrates.Entity.Spot_Check.S_C_PointEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

@Mapper
@DS("db02")
public interface S_C_DatesMapper extends BaseMapper<S_C_DatesEntity> {

    @Select("SELECT * FROM s_c_dates ORDER BY id DESC LIMIT 1")
    S_C_DatesEntity findOrderByIDLimit1();

    @Select("select distinct date,point from s_c_dates where date < CURDATE() + 1 order by date desc limit #{start},#{size}")
    List<S_C_DatesEntity> findAllPointDailyTODataCenter(@Param("tomorrow")Date tomorrow, @Param("start") int start, @Param("size") int size);

    @Select("select count(distinct date,point) from s_c_dates where date < CURDATE() + 1")
    int findTotalCurrent();



}
